<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class RuleSerialNumber extends Controller
{
    //订单流水账号设置
    public function setRuleSerialNumber(Request $request){
        $params = $request->all();
        $model = \App\Models\RuleSerialNumber::first();
        if(!empty($params['prefix_custom'])){
            $model->prefix_custom = $params['prefix_custom'];
        }
        if(!empty($params['date'])){
            $model->date = $params['date'];
        }
        if(!empty($params['serial_number'])){
            $model->serial_number = $params['serial_number'];
        }
        $model->save();
        return re(0,$model,'success');
    }

    //获取流水号设置
    public function getRuleSerialNumber(Request $request){
        $model = \App\Models\RuleSerialNumber::first();
        return re(0,$model,'success');
    }




}
